<!--
<!DOCTYPE html>
<html>
<head>
    <title>homepage</title>
</head>
<body>
 
<a href="{% url 'add2' 4 5 %}">compute 4+5</a>
<a href="{% url 'print_string' %}">print string</a>
<a href="{% url 'for_loop' %}">for loop</a>
<a href="{% url 'print_dict' %}">print dict</a>
<a href="{% url 'forloop_if' %}">forloop and if</a>
<a href="{% url 'use_if' %}">use if</a>
<a href="{% url 'get_url_user' %}">get url and user</a>
 
</body>
</html>
-->
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>我的博客</title>
    <style type="text/css">
           body{
        color: #efd;
        background: #CCCCCC;
        padding: 12px 5em;
        margin:7px;
    }
        h1{
            margin-top: -10px;
        padding: 2em ;
        background: #675;
    }
        h2{
        color: #85F2F2;
        border-top: 1px dotted #fff;
        margin-top:2em;
        }
        .blog{
            padding: 20px 0px;
        }
        .blog .info span{
            padding-right: 10px;
        }
        .blog .summary{
            padding-top: 20px;
        }
    </style>
</head>
<body>
<div class="header">
    <h1 align="center">我的博客</h1>
</div>
<h3 style="margin-bottom: -50px;font-size: x-large;">博客列表
</h3>
{% for blog in blogs %}
<div align="center" class="blog">
    <div class="title">
        <a href="{% url 'blog_get_detail' blog.id %}"><h2 align="left">{{ blog.title }}</h2></a>
    </div>

    <div class="info" align="left">
        <span class="category" style="color: #ff9900;">{{ blog.category.name }}</span>
        <span class="author" style="color: #4a86e8;">{{ blog.author }}</span>
        <span class="pub" style="color: #6aa84e">{{ blog.pub }}</span>
    </div>
    <div class="summary">
        <a href="{{ the_url }}">链接到：{{ the_url }}</a>
        {{ blog.content | truncatechars:100 }}
    </div>

</div>
{% endfor %}
</body>
</html>